import type { Module } from 'vuex'
import lkfRequest from '@/services'
import { IRootState } from '../types'
import { ISheetList } from './types'
/* 歌单store */
const sheet: Module<ISheetList, IRootState> = {
  namespaced: true,
  state() {
    return {
      sheetList: []
    }
  },
  getters: {},
  mutations: {
    getSheetListGetter(state, list) {
      state.sheetList = list
    }
  },
  actions: {
    /* 请求数据 */
    async getSheetListAction({ commit }) {
      const list = await lkfRequest.get({
        url: `/simi/playlist?id=347230`
      })
      commit('getSheetListGetter', list.playlists)
    }
  }
}
export default sheet
